/**
 * 
 */
package business;

import java.util.*;

import dbAccess.*;
import exceptions.*;

import model.*;

/**
 * @author Anthares & Hennek
 *
 */
public class SyllabusManager {
	public ArrayList<Syllabus> getSyllabus(int annee, int section_id) throws PasIdentificationException, DatabaseErrorException, InvalidDataException {
		if(annee<0||annee>3||section_id<0) throw new InvalidDataException();
		return new SyllabusDBAccess().getAllSyllabus(annee, section_id);
	}
	public HashMap<Syllabus, Integer> getSyllabusCommandeEtu(String status) throws PasIdentificationException, DatabaseErrorException{
		return new SyllabusDBAccess().getSyllabusCommandeEtu(status);
	}
	public int addSyllabus(Syllabus syl) throws EmptyFormException, PasIdentificationException, DatabaseErrorException {
		if(syl.getIntitule()==null || syl.getNb_page()<0) throw new EmptyFormException();
		return new SyllabusDBAccess().addSyllabus(syl);
	}
}
